package com.aaa.fpa.service;

import com.aaa.fpa.dao.AccountDao;
import com.aaa.pojo.Result;
import com.aaa.pojo.ResultBean;
import com.aaa.pojo.question_fpa;


import com.aaa.pojo.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class AccountServiceimpl implements AccountService{
    @Autowired
    private AccountDao accountDao;

    @Override
    public  ResultBean findAll(Page page,question_fpa question_fpa) {
        PageHelper.startPage(page.getPage(),page.getLimit());
        List<question_fpa> question_fpaList = accountDao.findAll(question_fpa);
        PageInfo<question_fpa >pageInfo = new PageInfo<question_fpa>(question_fpaList);
        return  new ResultBean(0 ,"查询成功",pageInfo.getTotal(),pageInfo.getList());

    }




    @Override
    public Integer delete (@Param("id") Integer id ) {
        System.out.println(id);
       return accountDao.delete(id);
    }
@Override
    public  int save( question_fpa question_fpa){
    return  accountDao.save(question_fpa);
}
@Override
    public  int update(question_fpa question_fpa){
        return accountDao.update(question_fpa);
}
@Override
    public  int deletes (@Param("id") Integer[] id){

            System.out.println(id);

    return accountDao.deletes( id);
}
}
